import API from '../api';
import http from '../utils/http';

export function getPinTuanData(tab, page, per_page){
  return new Promise((resolve,reject)=>{
    http({
      url:API.GET_PINGTUAN_TUIJIAN,
      method:'GET',
      data:{
        tab: tab || 'coutuan_home',
        page: page || 1,
        per_page: per_page || 20
      }
    })
    .then(({data,status})=>{
      if(status !== 200){
        return {}
      }else{
        resolve({
          pinTuanArr:data.data
        })
        console.log(data.data);
      }
    })
    .catch(error=>{
      console.log(error);
    })
  })
}
